{% extends 'page_layout_single.html' %}
{% block layout_content %}
<div class="double">
    {% for picture in page.picture_set.all|slice:":1" %}
        {% include 'picture_block.html' with picture=picture page=page %}
    {% empty %}
        {% include 'no_pictures_block.html' with page=page %}
    {% endfor %}
   <!-- <textarea id="editable" rows="1" cols="30"></textarea> -->
    {% for picture in page.picture_set.all|slice:"1:2" %}
        {% include 'picture_block.html' with picture=picture page=page %}
    {% endfor %}
    {% with length=page.picture_set.all|length %}
		{% if length < 2 and length > 0 %}
		    {% include 'no_picture_block.html' with page=page %}
		{% endif %}
    {% endwith %}

 <!--   <div style="display: hidden;">
        <form id="editTextForm" action="">
            {% csrf_token %}
            <input type="hidden" id="caption" value="moi"/>
            <input type="hidden" id="page_id" value="{{ page.id }}" />
        </form>
    </div> -->
</div>


<!-- <script type="text/javascript">
    $(document).ready(function(){
        $('#editable').change(function() {
            var capt = $('textarea#editable').val();
            var page_id = $('#page_id').val();
            $.post('/albums/add/caption/', $('#editTextForm').serialize());
        });
    });
</script> -->
{% endblock %}